package view.plugin
{
	import flash.display.Sprite;
	import flash.events.Event;
	import global.Define;
	
	public class PanelBase extends Sprite
	{
		public function PanelBase()
		{
			super();
			this.addEventListener(Event.ADDED_TO_STAGE, onAddToStage);
		}
		
		public function onAddToStage(evt:Event):void
		{
			this.x = (Define.SCREEN_WIDTH - this.width) / 2;
			this.y = (Define.SCREEN_HEIGHT - this.height) / 2;
		}
		
		public function show(v:Boolean):void
		{
			if(v)
			{
				var sprite:Sprite = ChessLobby.dialog;
				while(sprite.numChildren > 0)
					sprite.removeChildAt(0);
				sprite.addChild(this);
				showHandle();
			}
			else if(parent)
			{
				parent.removeChild(this);
				closeHandle();
			}
			ChessLobby.masks.visible = v;
		}
		
		public function closeHandle():void
		{
			
		}
		public function showHandle():void
		{
			
		}
	}
}